package com.chenu.gamscriptman.compoent;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author flyan
 * date 2019-12-25
 * @function 这个类记录全局变量的键，通过它获取
 */
@Component
public class Global {

    /* 全局变量 */
    /* 文件上传相关 */
    public static String UPLOAD_PATH;
    @Value("${upload.path}")
    public void setUploadPath(String uploadPath) {
        Global.UPLOAD_PATH = uploadPath;
    }
    /* 上传的文件数据 */
    public static MultipartFile UPLOAD_FILE;

    /* 文件下载相关 */
    public static String DOWNLOAD_PATH;
    @Value("${download.path}")
    public void setDownloadPath(String downloadPath) {
        Global.DOWNLOAD_PATH = downloadPath;
    }

    /* session中的 */
    public static final String SESSION_LOGIN_U_UID = "login_usr_uid";
    public static final String SESSION_LOGIN_U_UNAME = "login_usr_username";
    public static final String SESSION_LOGIN_U_NICKNAME = "login_usr_nickname";
    public static final String SESSION_LOGIN_U_ROLE = "login_usr_role";
    public static final String SESSION_ERR_MESSAGE = "glo_err_msg";
    public static final String SESSION_SUC_MESSAGE = "glo_suc_msg";

    /* redis中的 */
    public static final String REDIS_USER_PAGES = "user_pages";
    public static final String REDIS_SEARCH_ONLYROLE = "search_onlyRole";
    public static final String REDIS_EDIT_USER = "edit_user";

    public static final String REDIS_DEVICE_PAGES = "device_pages";
    public static final String REDIS_SEARCH_DEVICE = "search_device";
    public static final String REDIS_DEVICE_STATISTICS = "device_statistics";
    public static final String REDIS_DEVICE_WEEK_STATISTICS = "device_week_statistics";
    public static final String REDIS_DEVICE_GROUPNRS = "device_group_nrs";


    public static final String REDIS_USERDATA_PAGES = "userdata_pages";
    public static final String REDIS_SEARCH_USERDATA = "search_userdata";
    public static final String REDIS_USERDATA_STATISTICS = "userdata_statistics";
    public static final String REDIS_USERDATA_MAP = "userdata_map";

    public static final String REDIS_GAME_PAGES = "game_pages";
    public static final String REDIS_SEARCH_GAME = "search_game";
    public static final String REDIS_SEARCH_GAME_NAME_LIST = "search_game_name_list";
    public static final String REDIS_GAME_STATISTICS = "game_statistics";
    public static final String REDIS_EDIT_GAME = "edit_game";

    public static final String REDIS_GAMEDATA_PAGES = "gamedata_pages";
    public static final String REDIS_SEARCH_GAMEDATA = "search_gamedata";
    public static final String REDIS_GAMEDATA_STATISTICS = "gamedata_statistics";
    public static final String REDIS_EDIT_GAMEDATA = "edit_gamedata";
    public static final String REDIS_GAMEDATA_MAP = "gamedata_map";
    public static final String REDIS_GAMEDATA_MAP_JSON = "gamedata_map_json";

    public static final String REDIS_DOWNLOAD_FILE_PATH = "download_file_path";

    public static final String REDIS_DOCUMENT_CONTENT = "document_content";


}
